package com.gitee.java8;

import org.junit.jupiter.api.Test;

/**
 * @author gcq
 * @Create 2022-04-26
 */
public class DefaultFunction {

    interface MyFun {
        default String getName() {
            return "Hello Java 8";
        }
    }

    interface Named {
        default String getName() {
            return "Hello atguigu";
        }
        static void show() {
            System.out.println("Hello Static Function");
        }
    }

    class MyClass implements MyFun, Named{

        @Override
        public String getName() {
            return Named.super.getName();
        }
    }

    @Test
    public void test() {
        MyClass myClass = new MyClass();
        myClass.getName();
    }

}